import request from '@/utils/request'

export function getList(query) {
  return request({
    url: '/api/admin/fireTenement/page',
    method: 'get',
    params: query
  })
}

export function getAdd(query) {
  return request({
    url: '/api/admin/baseBuildingCode/getBuildingCode',
    method: 'get',
    params: query
  })
}

export function getTenement(id) {
  return request({
    url: '/api/admin/fireTenement/' + id,
    method: 'get'
  })
}

export function addTenement(Obj) {
  return request({
    url: '/api/admin/fireTenement',
    method: 'post',
    data: Obj
  })
}

export function editTenement(id, Obj) {
  return request({
    url: '/api/admin/fireTenement/' + id,
    method: 'put',
    data: Obj
  })
}

export function delTenement(id) {
  return request({
    url: '/api/admin/fireTenement/' + id,
    method: 'delete'
  })
}

export function excelTenement(query) {
  return request({
    url: '/api/admin/excel/excelFireTenement',
    method: 'GET',
    params: query
  })
}

export function queryHistoryTenement(id) {
  return request({
    url: '/api/admin/fireTenement/queryTenementHistory/' + id,
    method: 'GET'
  })
}

export function getAdminRerication(id) {
  return request({
    url: '/api/admin/fireBuilding/getAdminRerication',
    method: 'GET',
    params: { id }
  })
}
export function phoneValidate(username) {
  return request({
    url: '/api/admin/user/usernameVerification',
    method: 'get',
    params: { username }
  })
}
export function buildCodeValidate(buildCode) {
  return request({
    url: '/api/admin/fireTenement/buildCodeVerification',
    method: 'get',
    params: { buildCode }
  })
}
export function mergeData(data) {
  return request({
    url: '/api/admin/fireTenement/mergeTenement',
    method: 'PUT',
    data
  })
}

export function importParameter(data) {
  return request({
    url: '/api/admin/excel/importParameter',
    method: 'post',
    data
  })
}

